(function () {
  var items = [
    {href : 'ex-01.html', title : 'Example - Замыкания'},
    {href : 'ex-02.html', title : 'Example - Всплытие'},
    {href : 'ex-03.html', title : 'Example - Scope'}
  ];

  var script = document.getElementsByTagName('script');
  if (script.length > 0) {
    script = script[script.length - 1];
    var html = [], fragment = document.createDocumentFragment(), li = null, a = null;
    for (var i = 0, n = items.length; i < n; i++) {
      li = document.createElement('li');
      a = document.createElement('a');
      li.appendChild(a);
      fragment.appendChild(li);
      a.appendChild(document.createTextNode(items[i].title));
      a.setAttribute('href', items[i].href);
    }
    script.parentNode.appendChild(fragment);
  }
})();